package com.xxyy.mylive.ui.activity;

import android.view.View;

import com.orhanobut.logger.Logger;
import com.tencent.mm.sdk.modelmsg.SendAuth;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;
import com.xxyy.mylive.R;
import com.xxyy.mylive.http.HttpApi;
import com.xxyy.mylive.ui.BaseActivity;

public class DemoActivity extends BaseActivity {

    private IWXAPI api;
    @Override
    protected void setContentView() {
        setContentView(R.layout.activity_demo);
    }

    @Override
    protected void initUI() {
    }

    @Override
    protected void setListener() {

    }

    @Override
    protected void initData() {
        api = WXAPIFactory.createWXAPI(this,"wx96f2fb04aebc3c95",true);
        Logger.i("注册微信===="+api.registerApp("wx96f2fb04aebc3c95"));
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    public void loginWx(View view) {
        final SendAuth.Req req = new SendAuth.Req();
        req.scope = HttpApi.WEIXIN_SCOPE;
        req.state = HttpApi.WEIXIN_STATE;
        Logger.i("发送消息===" + api.sendReq(req));
//        Logger.i("微信登录");
    }
}
